package refundhandler

import (
	"github.com/gin-gonic/gin"
	"yundian/internel/app/dao"
	"yundian/internel/app/helper/request"
	"yundian/internel/pkg/dingo"
	. "yundian/internel/pkg/dingo/result"
)

//退款列表
func GetRefundList(c *gin.Context) {

	// 请求参数处理
	param := &request.RefundListReq{}
	dingo.ErrorIf(c.ShouldBindQuery(param)).Unwrap()

	// 查询结果
	data := dao.NewRefundDao().GetRefundListInfo(param)
	// 分页信息
	Response(c)("", CodeSuccess, ResponseList{
		PageNo:     param.PageNo,
		PageSize:   param.PageSize,
		TotalCount: data.Val().(int64),
		TotalPage:  0,
		Data:       data.Unwrap(),
	})(OK)
}
